import type { CollectDocsBodyT, CollectDocsListQueryT } from '@/@types/type-collect.ts';
import { request } from '@/shared/axios';
import { getUserAuth } from '@/utils/login.ts';

/**
 * 添加收藏
 */
export const addCollectApi = (params: CollectDocsBodyT) => {
  const token = getUserAuth();
  return request.post('/api-collect/v1/collect_article/add', { paths: [params] }, { headers: { token } });
};

/**
 * 取消收藏
 */
export const removeCollectApi = (params: CollectDocsBodyT) => {
  const token = getUserAuth();
  return request.post('/api-collect/v1/collect_article/remove', { paths: [params] }, { headers: { token } });
};

/**
 * 判断是否收藏
 */

export const getCollectStatusApi = (params: CollectDocsBodyT) => {
  const token = getUserAuth();
  return request.get('/api-collect/v1/collect_article/is_exist', {
    params,
    headers: { token },
  });
};
